<%@ include file="/en/jsp/static.jsp" %>

<%@ page import="linuxbox.poll.logic.*,linuxbox.bean.*" %>
<%@ taglib uri="/linuxbox/Poll.tld" prefix="poll" %>
<%
  //TODO: check user rights, only the author or admin can get here to conclude

  String SUBJECT = (String)request.getAttribute("SUBJECT");
  String DESCRIPTION = (String)request.getAttribute("DESCRIPTION");

  boolean SHOWVOTER = Integer.parseInt((String)request.getAttribute("SHOWVOTER")) != 0;
  int SENDRESULT = Integer.parseInt((String)request.getAttribute("SENDRESULT"));

  int ID = Integer.parseInt((String)request.getAttribute("ID"));

  String PERCENTIMAGE =BoxStatic.imageDir+ "bluedot.gif";
%>

<jsp:include page="/en/jsp/header.jsp" flush="true"/>

  <FORM action=<%=BoxStatic.servletDir%>BoxPollConcludeAction method=post>

<table width="100%" height=26 align=middle border=0 cellpadding=0 cellspacing=0 bgcolor="#f4f4f4" style="font-size:16px;color:#d05000">
<tr><td>
    &nbsp;<img src="<%=BoxStatic.imageDir%>itemball.jpg" width=14 height=15 border=0 align="absmiddle">
    <b><%=boxName%> - Poll Conclude</b>
</td></tr>
</table>

<hr width=\"100%\" color=#E06000 align=left>

<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
  <TBODY>
  <TR align=left bgColor=#7EC1F3>
    <TD noWrap colspan = 5><B><font size="+1">Question</FONT></B>
    </TD>
  </TR>
  <TR>
    <TD>
      <b><%=SUBJECT%></b>
    </TD>
  </TR>
  <TR>
    <TD>
      <FONT size=-1><%=DESCRIPTION%></FONT>
    </TD>
  </TR>
  <TR align=left bgColor=#7EC1F3>
    <TD noWrap colspan = 5><font size="+1"><B>Responses</B></FONT></TD>
  </TR>

  <poll:VoteResults pollID="<%=ID%>" showVoter="<%=Boolean.toString(SHOWVOTER)%>" percentImage="<%=PERCENTIMAGE%>" />

  <TR align=left bgColor=#7EC1F3>
    <TD noWrap colspan = 5><FONT face=arial,helvetica><B>Result distribution </B></FONT></B>
    </TD>
  </TR>
  <TR>
    <TD noWrap>
      <INPUT type=hidden value=<%=ID%> name=ID>
      <input type=radio name="SENDRESULT" value=0 <% if (SENDRESULT==0) out.print("checked"); %> >
      Do not send any results<br>
      <input type=radio name="SENDRESULT" value=1 <% if (SENDRESULT==1) out.print("checked"); %> >
      Send results to all the voters via email<br>
      <input type=radio name="SENDRESULT" value=2 <% if (SENDRESULT==2) out.print("checked"); %> >
      Send results to the person who created the poll via email
    </TD>
  </TR>
  <TR>
    <TD noWrap>
      <input type=submit value=Conclude name=SubmitConclude>
      <input type=button value="Cancel" onclick="window.history.go(-1)" >
    </TD>
  </TR>

  </TBODY>
</TABLE>

<hr width=\"100%\" color=#E06000 align=left>
</FORM>

<jsp:include page="/en/jsp/footer.jsp" flush="true"/>
